[mean_freq,max_freq,cut]= FFT_LINE(r,fsamp,thresh,graph) performs calculation of single-sides amplitude spectrum and estimates cutoff frequency for filtering ARGUMENTS r ... Column vector data (n x 1) fsamp ... sampling rate of signal thresh ... threshold value to choose cutoff frequency. Default 10 graph ... Generate plot of data (Boolean). Default true RETURNS mean_freq ... Weighted mean frequency of signal max_freq ... Frequency with maximum amplitude cut ... Estimated cutof frequency EXAMPLE here is a signal sampled at 1000Hz with a frequency of 10Hz. The fourier transform clearly shows a spike at 10Hz t = (0:0.001:1); x = sin(20*pi*t); fft_line(x,1000) See also fft, bmech_filter, filter_data, filter_line